package com.nodecollege.cloud.client.feign;

import com.nodecollege.cloud.client.fallback.ChatDebateClientFallback;
import com.nodecollege.cloud.common.model.DebateDTO;
import com.nodecollege.cloud.common.model.NCResult;
import com.nodecollege.cloud.common.model.po.ChatDebate;
import com.nodecollege.cloud.common.model.po.ChatDebateRelation;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.context.annotation.Primary;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @author LC
 * @date 2020/1/10 9:47
 */
@Primary
@FeignClient(value = "CHAT", path = "/debate", fallback = ChatDebateClientFallback.class)
public interface ChatDebateClient {

    /**
     * 添加辩论堂
     */
    @PostMapping("/addDebateApi")
    NCResult<ChatDebate> addDebateApi(@RequestBody DebateDTO debate);

    /**
     * 批量添加节点和辩论堂关系列表
     */
    @PostMapping("/addRelation")
    NCResult addRelation(List<ChatDebateRelation> relationList);

    /**
     * 查询辩论堂缓存信息
     */
    @PostMapping("/getDebateCache")
    NCResult<ChatDebate> getDebateCache(@RequestBody ChatDebate debate);
}
